Okay, so today is quite a cool lesson.
We're going to be having a look at sounds how to add sounds into your game.
So in properties you can change and all that kind of stuff.
So there are two places you can add sounds into your game.
You can add them either into the workspace or into sound service.
Okay.
The difference between the two, if you add it into the workspace, you need to add it inside of a part,
and it will basically originate from that part.
So the sound will come from that part.
And the further away you get from the part, the quieter the sound will be.
Put it in sound service, however, and you will be able to hear it throughout your game.
So this is really good for things like background sounds, whereas sounds like doors opening.
You want to put into the workspace.
Okay, to add a sound in.
You just add a sound object.
So let's go into sound service and let's click the plus icon and search up a sound and just add it in
like that there.
Okay.
So this is this is similar to a decal.
However you have a bunch of properties.
But you have one property where the ID goes the sound ID property here okay.
Each sound has its own number.
It's called a sound ID.
And you put that sound ID into here so you can put it into your own game.
Okay.
So let's go over to the toolbox.
And this is how you find some audio, some sounds to use.
So go over to click on where it says models or images.
But change the selection to audio and look something like this.
You can either change between music and sound effects.
I'm going to use the sound effects and I'm going to use this rain on leaves sound effect here.
Okay.
So let's left click on that.
Um, and it adds us, adds it into our game for us.
And if you want to hear how this sounds you can click the plus icon.
So not the plus icon, the play icon when you hover over it and it will play it for you here.
I'm not sure how how well you're going to be able to hear that.
But hopefully you can hear that in the background as it's playing.
That's what it sounds like.
Okay.
Um, and you can also click insert there as well.
So let's get the sound for this.
So let's copy the ID here and just paste it into our own sound.
Okay.
So now we actually have a sound on here.
We can change some of the properties.
So you can preview the sound by just clicking the plus.
You can you can toggle this so you can hear different parts of the sound okay.
The time length is a faded out property, but basically it tells you the length of your sound.
So my sound here is 56 seconds.
He emitter stuff here.
Um, ignore that for now.
That's you don't need to know about just yet.
And then playback.
You can click looped.
This basically means when the sound finishes finishes, does it continue to play or does it just stop?
Um, playback regions enabled.
This is basically, um, where you can turn on a region where it will be heard or won't be heard.
We want this to be heard everywhere.
So we're going to turn that off.
Playback speed is obviously how fast it's playing the sound.
Okay, we'll leave it as one.
Um.
Playing is whether it's playing or not.
Let's turn that on because I want I want my sound to be playing time position.
So this is a cool one if you don't want it.
If you don't want the sound to start at the start, you can change the time position and it will start
further in and you can start at a certain point you want it to start at, which is pretty cool.
And then volume, volume you can increase all the way to ten.
And it's basically how loud the sound is.
This is a sound effect, a kind of background.
Um, so we're going to just put that to a standard of 0.5, okay.
And they are all all the properties of the sounds okay.
So they hopefully are quite simple.
It's just worth playing some time position the volume looped and some other ones there as well.
Okay.
So how do we actually figure out if this sound works in our game or what it sounds like?
Because we can preview the sound, but how do we know what it is, what it's like in our game?
Well, we need to play the game for that now.
Um.
You obviously can, you know, publish your game and then play it.
Um.
It through roadblocks, but you can also play it in Roblox studio.
Now, this is something I haven't explained yet in the course because it's it's something that you use
more for scripting than you do for, um, building.
But, um, to play the game, it's just here actually, you can just click this play icon here under
the test section to play.
But um, we are going to look look at that more um, later on in the course.
And hopefully you can hear that the rain on leaves sound effect is playing as well.
Um, hopefully you can hear that.
Okay, cool.
So yeah, that's how you add background sound into your game.
Pretty cool.
Now, I mentioned at the start as well that you can do the same thing for parts.
So if we add a part into our game and add a sound inside of that part, now the sound will be kind of
coming out of the part.
And if you go further enough away from it, you won't be able to hear the sound anymore.
Let's go for toolbox.
And maybe you want to play a sound.
Um, let's maybe go for an air raid siren.
Let's use that.
And again copy the ID.
And then just delete that and put it into our own one.
Okay.
Is this a bit loud?
That should be a fine volume.
Okay, so if I'm correct, we can start off close to it.
And as we go further away, it should start to get quieter and quieter.
Let's turn looped on as well in case it takes a while to move away.
Um, playback regions.
Let's turn that on and, um.
The max here is six.
60,000.
But let's leave that as that for that.
Okay, let's play the game and see what happens when we start to walk away from this part.
So it's there.
Let's move away from it.
And hopefully you can hear.
That it's getting quieter.
And if we go to that sound and play it again.
So I'm previewing it there.
I need to be playing.
It is actually it is actually playing.
You can hear it just about.
But it's very difficult to hear.
It might not pick up on my microphone.
But it is playing in the distance, but just very quietly.
Okay, so when you are when you are adding sounds into your game, just think, do do I want this to
be heard everywhere, or do I just want this to be heard in a certain area?
If it's a certain area, you need to put it inside of a part.
If it's everywhere, it needs going to sound service.
Okay, now you can actually upload sounds yourself.
However, there are a bit more difficult to do than uploading images by yourself.
Um, but that is something that we can have a look at later on in the course as well.
So I hope you enjoyed adding sounds into your game.
A very cool addition and again, can give your game a bit more life to it.
Um, so definitely something I'd definitely recommend adding into your own game.
Um, but yeah, now you know how to do them.
And next lesson we're going to have a look at something new.
We're going to have a look at tools, what they are and how to create our own ones.